<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <table id="userTable">
        <tr>
            <td>名字</td>
            <td>家乡</td>
            <td>城市</td>
            <td>工作</td>
            <td>格言</td>
        </tr>

    </table>
    <script>
        const person = {
            name: 'Cavan',
            hometown: '萍乡',
            city: '长沙',
            job: 'Web Developer',
            bio: '我的青春没有后悔'
        }
        // js 通向html世界的编程 ->DOM
        const tableElement = document.querySelector('#userTable');
        // es6 可以允许 `` 里的内容换行
        tableElement.innerHTML +=
            `<tr>
            <td>${person.name}</td>
            <td>${person.hometown}</td>
            <td>${person.city}</td>
            <td>${person.job}</td>
            <td>${person.bio}</td>
        </tr>`

    </script>
</body>

</html>